using System.IO;

namespace FileDirUtils
{
    public class FileCompareDate : IFileCompare
    {
        public FileCompareResult CompareFiles(string f1, string f2)
        {
            FileInfo fileInfo1 = new FileInfo(f1);
            FileInfo fileInfo2 = new FileInfo(f2);

            if (!fileInfo1.Exists)
                return FileCompareResult.File1_Not_Existing;

            if (!fileInfo2.Exists)
                return FileCompareResult.File2_Not_Existing;

            if (fileInfo1.CreationTime != fileInfo2.CreationTime)
                return FileCompareResult.Different_Date;
                
            return FileCompareResult.OK;            
        }
    }
}